#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <math.h> 
#include <ctype.h> 
#include <time.h> 
#include <assert.h>

int main()
{
	int n = 0;
	scanf("%d", &n);
	char arr[100];
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
	}
	int move = 0;
	scanf("%d", &move);

	char temp[100];
	for (int i = 0; i < n; i++)
	{
		int No = (i + move) % n;
		temp[No] = arr[i];
	}

	for (int i = 0; i < n; i++)
	{
		printf("%d ",temp[i]);
	}
	return 0;
}